public class Test_0727 {
    public static int max1(int a,int b) {
        return a>b?a:b;
    }
    public static int max2(int a,int b,int c)
    {
        return max1(max1(a,b),c);
    }
    public static void main6(String[] args) {
        System.out.println(max1(1,3));
        System.out.println(max2(1,3,9));
        System.out.println(factorial(5));
        System.out.println(sumFactorial(6));
        System.out.println(fibonacci(6));
    }

    public static int factorial(int a) {
        if(a<=0)
            return 1;
        else
            return a*factorial(a-1);
    }
    public static int sumFactorial(int a) {
        if(a<=1)
            return 1;
        else
            return sumFactorial(a-1)+factorial(a);
    }
    public static int fibonacci(int a) {
        if (a == 1 || a == 2)
            return 1;
        else {
            int tmp1 = 1, tmp2 = 1;
            int Fb=0;
            for (int i = 3; i <= a; i++) {
                Fb=tmp1+tmp2;
                tmp1=tmp2;
                tmp2=Fb;
            }
            return Fb;
        }
    }

}